package world.snowcrystal.configuration;

//@Configuration
//@EnableCaching
//@EnableConfigurationProperties(CacheProperties.class)
public class CacheConfiguration {
//
//    @Bean
//    public CacheManager cacheManager(RedisConnectionFactory lettuceConnectionFactory,CacheProperties cacheProperties) {
//        RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();
//        defaultCacheConfig.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
//                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
//                .disableCachingNullValues();
//
//        Map<String, RedisCacheConfiguration> configMap = new HashMap<>();
//        return RedisCacheManager.builder(lettuceConnectionFactory)
//                .cacheDefaults(defaultCacheConfig)
//                .initialCacheNames(new HashSet<>(cacheProperties.getCacheNames()))
//                .withInitialCacheConfigurations(configMap)
//                .build();
//
//    }
}
